<!--
  @author yangjiangming
  @date 2018-12-10 20:40:28
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html th:replace="~{work/modify/common/layout :: layout('算账', ~{::title}, ~{::content}, ~{::script})}"
      xmlns:th="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/html">
<head>
    <title>工单管理-算账</title>
</head>
<body>

<div th:fragment="content">
    <link rel="stylesheet" href="/static/style/work/modify/account.css">

    <form class="layui-form" action="" onkeydown="if(event.keyCode==13){return false}">
        <input type="text" name="orderId" th:value="${accountVo.orderId}" hidden>
        <input type="text" name="workId" th:value="${accountVo.workId}" hidden>
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">订单收入:</label>
                <div class="layui-inline" style="">
                    <p class="" style="line-height: 35px"
                       th:text="${#moneyUtil.parseToYuanEndWithUnit(accountVo.totalAmount)}"></p>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">实收现金:</label>
                <div class="layui-input-inline" style="width: 65px">
                    <p class="" style="line-height: 35px"
                       th:text="${#moneyUtil.parseToYuanEndWithUnit(accountVo.cashTotalAmount)}"></p>
                </div>
            </div>
            <div class="layui-inline">
                <label class="layui-form-label">实收非现金:</label>
                <div class="layui-input-inline" style="width: 65px">
                    <p class="" style="line-height: 35px"
                       th:text="${#moneyUtil.parseToYuanEndWithUnit(accountVo.unCashTotalAmount)}"></p>
                </div>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">配件明细:</label>
            <div class="layui-input-block masterpartdetail" style="margin-right: 40px">
                <table class="layui-table" id="partdetail-table" lay-filter="partdetail-table"></table>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">工程师提留<br>(老财务系统)</label>
            <div class="layui-input-block masteramount" style="margin-right: 40px">
                <table class="layui-table" id="masteraccount-table" lay-filter="masteraccount-table"></table>
                <p id="fico_tag" style="margin-top: 10px;text-align:right;color: #999999;"></p>
            </div>

            <div class="erpAccount">
                <div class="layui-form-item" th:if="${accountVo.serviceProviderVO == null}">
                    <label class="layui-form-label">工程师提留<br>(ERP系统)</label>
                    <div class="layui-input-block" style="margin-right: 40px">
                        <table class="layui-table" id="erp-masteraccount"
                               lay-filter="erp-masteraccount"></table>
                        <p id="erp_tag" style="margin-top: 10px;text-align:right;"></p>
                    </div>
                </div>
                <div class="layui-form-item" th:if="${accountVo.serviceProviderVO != null}">
                    <label class="layui-form-label">服务商提留<br>(ERP系统)</label>
                    <div class="layui-input-block" style="margin-right: 40px">
                        <table class="layui-table" id="erp-spaccount"
                               lay-filter="erp-spaccount"></table>
                        <p id="erp_tag" style="margin-top: 10px;text-align:right;color: #999999;"></p>
                    </div>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">备注:</label>
                <div class="layui-input-block" style="margin-right: 40px">
                    <textarea placeholder="请输入内容" class="layui-textarea" name="operatorRemark"></textarea>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"></label>
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="confirm">确认</button>
                </div>
            </div>

        </div>
    </form>
</div>

<script th:replace="work/modify/account/_refund_template :: templates"/>

<script th:inline="javascript">
    var accountVo = [[${accountVo}]];
    var layuiModel =              {
        oms_work_modify_refund_account: 'work/modify/zmn.oms.work.modify.refund.account'
    }
</script>
</body>
</html>